package com.briup.day11.abBean;

public abstract class Dog extends Animal {
    private int loyalValue;
    public Dog(String color,int age,int loyalValue) {
        super(color,age);
        this.loyalValue = loyalValue;
    }

    public Dog() {
    }
//抽象子类可以只重写部分抽象方法

    @Override
    public void eat() {
        System.out.println("狗喜欢吃狗粮");
    }
    @Override
    public void sleep() {
        System.out.println("狗喜欢趴着睡");
    }

    @Override
    public String toString() {
        return "Dog{" +
                "loyalValue=" + loyalValue +
                "} " + super.toString();
    }
}
